package com.hfmall.service.impl;

import com.hfmall.common.ClassVo;
import com.hfmall.entity.HfClass;
import com.hfmall.mapper.HfClassMapper;
import com.hfmall.service.IHfClassService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author liclo
 * @since 2021-08-12
 */
@Service
public class HfClassServiceImpl extends ServiceImpl<HfClassMapper, HfClass> implements IHfClassService {
    @Resource
    private HfClassMapper hfClassMapper;

    @Override//根据分类id查询-规格类型
    public List<HfClass> getClassByCategoryId(int categoryId) {
        return hfClassMapper.getClassByCategoryId(categoryId);
    }

    @Override
    public List<ClassVo> getAllClass(Integer id) {
        return hfClassMapper.getAllClass(id);
    }

    /**
     * 获取所有的规格名字,不重复
     */
    @Override
    public List<String> getAllOnceClass() {
        return hfClassMapper.getAllOnceClass();
    }
}
